<template>
  <el-config-provider :locale="locale">
    <router-view />
  </el-config-provider>
</template>

<script lang="ts" setup>
import { onMounted } from 'vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import { useTitle } from '@/hooks/web/useTitle'
import { useTheme } from '@/hooks/web/useTheme'

defineOptions({
  name: 'App'
})

const { initTheme } = useTheme()

const locale = zhCn
// 监听页面变化和动态改变站点标题
useTitle()
// 初始化主题色

onMounted(() => {
  initTheme()
})
</script>
